

#ifndef  _CLIENT_H
#define  _CLIENT_H
#include "MySocket.h"
#include "MsgQueue.h"
//#include "TypeMsg.h"
#include <list>
class CMessage;
class Client : public MySocket
{
public:
	Client();
	~Client();

	void  SendMessage( CMessage *msg);

	void  SetFlag(long lFlag) { m_lFlag = lFlag; }
	long  GetFlag() { return m_lFlag ; }

	/// Client Thread
	void StartNet();
	void PushMessage(CMessage *pMsg){ m_msgQueue.PushMessage(pMsg); }
	CMsgQueue& GetMsgQueue()        { return m_msgQueue; }
	//void* StartRecvThread(void *);

	static void StartThread();
	static void StartSendNetThread();

private:
	long				  m_lFlag;
	//pthread_t			  s_networkThreadSend;
	pthread_t			  s_networkThreadRecv;
	std::list<CMessage*>  m_sendlistMsg;
	std::list<CMessage*>  m_recvlistMsg;
	CMsgQueue			  m_msgQueue;
};

#endif